home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_6136_000029.msg < prev    next >
Encoding:
Text File  |  1994-11-27  |  2.2 KB  |  50 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!uni-heidelberg!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb!feck
  3. From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
  4. Subject: Re: How to detach from cli.
  5. Message-ID: <1994Feb17.165346@informatik.uni-kl.de>
  6. Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
  7. Nntp-Posting-Host: uklirb.informatik.uni-kl.de
  8. Organization: University of Kaiserslautern, Germany
  9. References: <80d.ANN@yaps.dinoco.de>  <1994Feb8.193709@informatik.uni-kl.de>   <1994Feb8.110410.22728@dmu.ac.uk> <19940209145315.M.F.C.vdnHout@sp0099.kub.nl> <19940216211004.M.F.C.vdnHout@sp0002.kub.nl>
  10. Date: Thu, 17 Feb 1994 15:53:46 GMT
  11. Lines: 37
  12.  
  13. In article <19940216211004.M.F.C.vdnHout@sp0002.kub.nl>, M.F.C.vdnHout@kub.nl  (Marco van den Hout) writes:
  14. > "feck@informatik.uni-kl.de (Christoph Feck IRZ)" says about detaching:
  15. >  
  16. > 1) clear the cli_module pointer... okay that's easy.. that prevents the
  17. >    program to be unloaded when it exits..
  18. > 2) start a process (using CreateNewProc) with the same seglist and a
  19. >    different entry point...
  20. >  
  21. > This I don't get - RKRM Includes & Autodocs says  NP_SegList and
  22. > NP_Entry are mutually exclusive.. then how can you use the same
  23. > seglist while starting at another entry point? Only way I see is to
  24. > check if the program was already started at the beginning..
  25.  
  26. Either:
  27. Use NP_Entry.  Send the new process a startup message
  28. (to pr_MsgPort).  In this message place a pointer to the
  29. seglist.  The called task can free this seglist later.
  30. Be sure to exit the calling task only after you got an 'OK'
  31. reply from the detached task.  If your program isn't going
  32. to be 'resident' (reentrant), you can avoid all the message
  33. passing and just store the segment pointer in a variable,
  34. which is referenced via A4.  The entry function must then
  35. use __saveds of course.
  36.  
  37. Or:
  38. In the non-reentrant case, you can use NP_SegList, and check
  39. a global variable first (like you suggested).
  40.  
  41. > By the way, I'm trying to program this in assembler, not in C.
  42.  
  43. That doesn't matter :)
  44.  
  45. Ciao,
  46. Christoph
  47.  
  48. 3k// Christoph Feck, TowerSystems
  49. \X/ Amiga - Intuition inside.
  50.